﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YXAndBJ.aspx.cs" Inherits="StudentManage.Web.Admin.Management.SysManage.YXAndBJ" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register src="/Admin/PageHead/UC_Head.ascx" tagname="UC_Head" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <uc1:UC_Head ID="UC_Head1" runat="server" />
    <style type="text/css">
        <!--
            .Student_Left{width:200px; border:1px solid #999;}
            .Student_Left h2{width:200px; height:25px; line-height:25px; font-size:14px; text-align:center; border-bottom:1px solid #999; background-color:#e1e5ee;}
            .Student_LeftMain{width:200px; height:450px; overflow:auto;}
            .Student_LeftBtn{width:200px;padding-top:10px; padding-bottom:10px;}
            .Student_LeftBtn li{width:200px; text-align:center;}
            .Student_Right_Title{width:100%;height:25px; line-height:25px; font-size:14px; font-weight:600; border-bottom:1px solid #ccc;}
            .Student_Right_Btn{width:100%; padding:10px 0px; text-align:right;}
        -->
    </style>
    <script src="../../../js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#ck_all").click(function () {
                $("#UserTbody input").attr("checked", $(this).attr("checked") == "checked" ? "checked" : false);
            });
            $("#TV_Student input[type='checkbox']").click(function () {
                if ($(this).attr("checked")) {
                    $(this).parents("table").nextAll("div:first").find("input[type='checkbox']").attr("checked", true);
                }
                else {
                    $(this).parents("table").nextAll("div:first").find("input[type='checkbox']").attr("checked", false);
                }
            });

        });
        function IsV() {
            var selectedItem = "";
            $("#UserTbody input").each(function () {
                selectedItem += ($(this).attr("checked") == "checked" ? $(this).val() + "," : "");
            });
            $("#hidSelectItem").val(selectedItem);

            var b = true;
            if ($("#HidSelectId").val() == "") {
                b = false;
                alert("请选择系别！");
            }
            if ($("#hidSelectItem").val() == "") {
                b = false;
                alert("请选择班级！");
            }
            return b;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="HidScrollValue" runat="server" Value="0" />
    <asp:HiddenField ID="HidSelectId" runat="server" Value="" />
    <asp:HiddenField ID="hidSelectItem" runat="server" Value="" />
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="17" height="29" valign="top" background="../images/mail_leftbg.gif">
                <img src="../../images/left-top-right.gif" width="17" height="29" />
            </td>
            <td height="29" valign="top" background="../images/content-bg.gif">
                <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg"
                    id="table2">
                    <tr>
                        <td height="31">
                            <div class="titlebt">关联配置</div>
                        </td>
                    </tr>
                </table>
            </td>
            <td width="16" valign="top" background="../images/mail_rightbg.gif">
                <img src="../../images/nav-right-bg.gif" width="16" height="29" />
            </td>
        </tr>
        <tr>
            <td height="71" valign="middle" background="../../images/mail_leftbg.gif">
                &nbsp;
            </td>
            <td valign="top" bgcolor="#F7F8F9">
                <table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="13" valign="top">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td colspan="3" class="left_txt">
                                        当前位置：系别班级关联配置
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3" style="height:1px;padding-top:10px; border-top:1px solid #ccc;"></td>
                                </tr>
                                
                                <tr>
                                    <td valign="top" align="left" style="width:202px;">
                                        <div class="Student_Left">
                                            <h2>学院系别</h2>
                                            <div class="Student_LeftMain TV_List_Main">
                                                <asp:TreeView ID="TV_Student" runat="server"  CssClass="TV_List_A"
                                                    onselectednodechanged="TV_Student_SelectedNodeChanged" SkipLinkText="">
                                                    <SelectedNodeStyle BackColor="#FFCC00" />
                                                </asp:TreeView>
                                            </div>
                                        </div>
                                        <div class="Student_LeftBtn" node-type="header_table">
                                            <ul>
                                                <li><asp:Button ID="Btn_ClearAnd" runat="server" Text="取消关联" 
                                                        onclick="Btn_ClearAnd_Click" /></li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td style="width:10px;"></td>
                                    <td valign="top">
                                        <div class="Student_Right_Title">所选系别：<asp:Label ID="Lab_xq" runat="server"></asp:Label></div>

                                        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="height:40px;" node-type="header_table">
                                            <tr>
                                                <td style="width:80px;">班级名称：</td>
                                                <td style="width:120px;"><asp:TextBox ID="txt_BJMC" runat="server"></asp:TextBox></td>
                                                <td align="right" style="width:60px;">年级：</td>
                                                <td style="width:180px;"><asp:TextBox ID="txt_NJ" runat="server"></asp:TextBox></td>
                                                <td align="left"><asp:Button ID="Btn_Search" runat="server" OnClick="Btn_Search_Click" Text="查询" /></td>
                                            </tr>
                                        </table>

                                        <table width="100%" border="1" cellspacing="0" cellpadding="0" class="table120" style="border-collapse:collapse;margin-top:5px;">
                                            <thead class="nowtable">
                                                <tr>
                                                    <th style="width:60px;height: 25px; line-height: 25px;">
                                                        <input type="checkbox" id="ck_all" value=""/> 全选
                                                    </th>
                                                    <th>
                                                        班级代码
                                                    </th>
                                                    <th>
                                                        班级名称
                                                    </th>
                                                    <th>
                                                        年级
                                                    </th>
                                                </tr>
                                            </thead>
                                            <tbody id="UserTbody">
                                                <asp:Repeater ID="Rep_DataList" runat="server">
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td><input type="checkbox" value="<%#Eval("BJDM")%>" /></td>
                                                            <td><%#Eval("BJDM")%></td>
                                                            <td><%#Eval("BJMC")%></td>
                                                            <td><%#Eval("NJ") %></td>
                                                        </tr>
                                                    </ItemTemplate>
                                                </asp:Repeater>
                                            </tbody>
                                        </table>
                                        <webdiyer:aspnetpager id="AspNetPager1" runat="server" pagesize="15" 
                                            firstpagetext="首页" lastpagetext="尾页" nextpagetext="下一页" prevpagetext="上一页" 
                                            showpageindex="true" onpagechanged="AspNetPager1_PageChanged">
                                         </webdiyer:aspnetpager>
                                         <div class="Student_Right_Btn" node-type="header_table"><asp:Button ID="Btn_SetAnd" 
                                                 runat="server" OnClientClick="return IsV()" Text="设置关联" 
                                                 onclick="Btn_SetAnd_Click" /></div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
            <td background="../../images/mail_rightbg.gif">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="middle" background="../images/mail_leftbg.gif">
                <img src="../../images/buttom_left2.gif" width="17" height="17" />
            </td>
            <td height="17" valign="top" background="../../images/buttom_bgs.gif">
                <img src="../../images/buttom_bgs.gif" width="17" height="17" />
            </td>
            <td background="../images/mail_rightbg.gif">
                <img src="../../images/buttom_right2.gif" width="16" height="17" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

